/*
todo:
  make me into a useful class

*/
#include "StdAfx.h"
#include "Params.h"

static char **myargv;
static int myargc;

void ParameterInit_Arg(char **gv,int gc)
{
myargv = gv;
myargc = gc;
}

void ParameterInit_CmdLine(char *cmdline)
{
message("ParameterInit_CmdLine: not implemented\n");
}

int CheckParameter(char *n)				//see if parameter was passed
{
int i;

for(i=1;i<myargc;i++)
	{
	if(strcmp(n,myargv[i]) == 0)			//names match, return success
		return(1);
	}
return(0);										//not found
}

char *GetParameterData(char *n)			//get parameter data
{
int i;

for(i=1;i<myargc;i++)
	{
	char *name = myargv[i];					//parameter name
	char *data = myargv[i+1];				//(possible) parameter data
	
	if(strcmp(n,name) == 0)					//names match, return data
		return(data);
	}
return(0);
}
